/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.aeso.betabit.util;

import br.aeso.betabit.service.rmi.ApostaService;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Edson
 */
public class RMIClient {

    public static ApostaService getApostaService() {
        try {
            Registry r = LocateRegistry.getRegistry(8081);
            return (ApostaService) r.lookup("ApostaServiceImpl");
        } catch (Exception ex) {
            Logger.getLogger(RMIClient.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }
}
